<?php
$user = $this->request->data;
?>

<div class="row-fluid">
    <div class="span2">
        <div>
            <p class="nav-header">Actions</p>
            <ul class="nav nav-tabs nav-stacked">
                <li>
                    <form action="<?php echo $this->Html->url('delete/' . $user['Admin']['id']); ?>" name="post_delete" id="post_delete" style="display:none;" method="post">
                        <input type="hidden" name="_method" value="POST">
                    </form>
                    <a href="#" onclick="if (confirm('Are you sure you want to delete #<?php echo $user['Admin']['id']; ?>?')) {
                                document.post_delete.submit();
                            }
                            event.returnValue = false;
                            return false;">Delete</a>
                </li>
                <li><a href="<?php echo $this->Html->url('index/'); ?>">List Users</a></li>
            </ul>
        </div>
    </div>
    <div class="span10">
        <form action="<?php echo $this->Html->url('edit/' . $user['Admin']['id']); ?>" class="well" id="UserEditForm" method="post" accept-charset="utf-8">
            <div style="display:none;">
                <input type="hidden" name="_method" value="PUT">
            </div>        
            <fieldset>
                <legend>Edit User</legend>
                <input type="hidden" name="id" help="" value="<?php echo $user['Admin']['id']; ?>" id="UserId">
                <div class="control-group required">
                    <label for="UserUsername">Username</label>
                    <input name="username" help="" maxlength="45" type="text" value="<?php echo $user['Admin']['username']; ?>" id="UserUsername" required="required">
                </div>
                <div class="control-group required">
                    <label for="UserPassword">Password</label>
                    <input name="password" help="" type="password" value="" id="UserPassword">
                </div>
                <div class="control-group required">
                    <label for="UserEmail">Email</label>
                    <input name="email" help="" maxlength="45" type="email" value="<?php echo $user['Admin']['email']; ?>" id="UserEmail" required="required">
                </div>                
                <div class="control-group">
                    <label for="UserStatus">Status</label>
                    <select name="status" help="" id="UserStatus">
                        <option value="1" <?php echo ($user['Admin']['status'] ? 'selected=selected' : ''); ?>>Yes</option>
                        <option value="0" <?php echo (!$user['Admin']['status'] ? 'selected=selected' : ''); ?>>No</option>
                    </select>
                </div>
            </fieldset>        
            <div class="submit">
                <input class="btn btn-primary" type="submit" value="Save">
            </div>
        </form>    
    </div>
</div>